#!/user/bin/env python
# -*- coding: utf-8 -*-

def f(max):
    a,b,c,s=0,0,0,0
    while a < max :
       b= 10*b+a
       c = a+1
       s = b*9+c		
       print '%s x 9 + %s = %s' % (b,c,s)
       a = a + 1
        
#f(9)
##0 x 9 + 1 = 1 
##1 x 9 + 2 = 11 
##12 x 9 + 3 = 111 
##123 x 9 + 4 = 1111 
##1234 x 9 + 5 = 11111 
##12345 x 9 + 6 = 111111 
##123456 x 9 + 7 = 1111111 
##1234567 x 9 + 8 = 11111111 
##12345678 x 9 + 9 = 111111111 

def sumtree(L=None):
    tot = 0
    for x in L:
        if isinstance(x,str):
            print x
        elif not isinstance(x,list):
            tot +=x
        else:
           tot += sumtree(x)           
    return tot

#print sumtree([1,[2,3],4);
#10

#if __name__=='__main__':
   
